FROM centos:7.8.2003
MAINTAINER 无涯
#下载yum
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo  https://mirrors.aliyun.com/repo/Centos-7.repo;
RUN curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo;
#安装Python环境
RUN yum install python3-devel python3-pip -y
#安装flask库
RUN pip3 install -i https://pypi.douban.com/simple   flask
RUN pip3 install -i https://pypi.douban.com/simple   flask_restful
#复制文件到容器目录
COPY app.py /opt
#切换目录
WORKDIR /opt
#启动服务
EXPOSE 5000
CMD ["python3","app.py"]